package com.google.ads.b;

import android.content.Context;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.View.MeasureSpec;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.google.ads.AdActivity;
import com.google.ads.as;
import com.google.ads.g;
import com.google.ads.util.AdUtil;
import com.google.ads.util.ac;
import com.google.ads.util.n;
import com.google.ads.util.p;
import com.google.ads.util.y;
import java.lang.ref.WeakReference;

public class c extends WebView
{
  private WeakReference a;
  private g b;
  private boolean c;
  private boolean d;
  private boolean e;

  public c(as paramas, g paramg)
  {
    super((Context)paramas.f.a());
    this.b = paramg;
    this.a = null;
    this.c = false;
    this.d = false;
    this.e = false;
    setBackgroundColor(0);
    AdUtil.a(this);
    WebSettings localWebSettings = getSettings();
    localWebSettings.setSupportMultipleWindows(false);
    localWebSettings.setJavaScriptEnabled(true);
    localWebSettings.setSavePassword(false);
    setDownloadListener(new d(this));
    if (AdUtil.a >= 11)
      n.a(localWebSettings, paramas);
    setScrollBarStyle(33554432);
    if (AdUtil.a >= 14)
      setWebChromeClient(new y(paramas));
    while (AdUtil.a < 11)
      return;
    setWebChromeClient(new p(paramas));
  }

  public void a()
  {
    AdActivity localAdActivity = d();
    if (localAdActivity != null)
      localAdActivity.finish();
  }

  public void b()
  {
    if (AdUtil.a >= 11)
      n.a(this);
    this.d = true;
  }

  public void c()
  {
    if ((this.d) && (AdUtil.a >= 11))
      n.b(this);
    this.d = false;
  }

  public AdActivity d()
  {
    if (this.a != null)
      return (AdActivity)this.a.get();
    return null;
  }

  public void destroy()
  {
    try
    {
      super.destroy();
      setWebViewClient(new WebViewClient());
      return;
    }
    catch (Throwable localThrowable)
    {
      com.google.ads.util.d.b("An error occurred while destroying an AdWebView:", localThrowable);
    }
  }

  public boolean e()
  {
    return this.e;
  }

  public boolean f()
  {
    return this.d;
  }

  public void loadDataWithBaseURL(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
  {
    try
    {
      super.loadDataWithBaseURL(paramString1, paramString2, paramString3, paramString4, paramString5);
      return;
    }
    catch (Throwable localThrowable)
    {
      com.google.ads.util.d.b("An error occurred while loading data in AdWebView:", localThrowable);
    }
  }

  public void loadUrl(String paramString)
  {
    try
    {
      super.loadUrl(paramString);
      return;
    }
    catch (Throwable localThrowable)
    {
      com.google.ads.util.d.b("An error occurred while loading a URL in AdWebView:", localThrowable);
    }
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    int i = 2147483647;
    try
    {
      if (isInEditMode())
        super.onMeasure(paramInt1, paramInt2);
      while (true)
      {
        return;
        if ((this.b != null) && (!this.c))
          break;
        super.onMeasure(paramInt1, paramInt2);
      }
    }
    finally
    {
    }
    int j = View.MeasureSpec.getMode(paramInt1);
    int k = View.MeasureSpec.getSize(paramInt1);
    int m = View.MeasureSpec.getMode(paramInt2);
    int n = View.MeasureSpec.getSize(paramInt2);
    float f = getContext().getResources().getDisplayMetrics().density;
    int i1 = (int)(f * this.b.a());
    int i2 = (int)(f * this.b.b());
    if (j != -2147483648)
      if (j == 1073741824)
        break label227;
    while (true)
    {
      label135: com.google.ads.util.d.e("Not enough space to show ad! Wants: <" + i1 + ", " + i2 + ">, Has: <" + k + ", " + n + ">");
      setVisibility(8);
      setMeasuredDimension(k, n);
      break;
      label227: label231: 
      do
      {
        setMeasuredDimension(i1, i2);
        break;
        int i3 = i;
        break label231;
        i3 = k;
        if ((m == -2147483648) || (m == 1073741824))
          i = n;
        if (i1 - f * 6.0F > i3)
          break label135;
      }
      while (i2 <= i);
    }
  }

  public void setAdActivity(AdActivity paramAdActivity)
  {
    this.a = new WeakReference(paramAdActivity);
  }

  public void setAdSize(g paramg)
  {
    try
    {
      this.b = paramg;
      requestLayout();
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public void setCustomClose(boolean paramBoolean)
  {
    this.e = paramBoolean;
    if (this.a != null)
    {
      AdActivity localAdActivity = (AdActivity)this.a.get();
      if (localAdActivity != null)
        localAdActivity.a(paramBoolean);
    }
  }

  public void setIsExpandedMraid(boolean paramBoolean)
  {
    this.c = paramBoolean;
  }

  public void stopLoading()
  {
    try
    {
      super.stopLoading();
      return;
    }
    catch (Throwable localThrowable)
    {
      com.google.ads.util.d.d("An error occurred while stopping loading in AdWebView:", localThrowable);
    }
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.google.ads.b.c
 * JD-Core Version:    0.6.2
 */